package study.java.jvm.controller.mem;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import study.kit.eggs.result.Result;
import study.kit.eggs.result.Results;

@Slf4j
@RestController
@RequestMapping("/stack")
public class StackController {

    @RequestMapping("/cpu")
    public Result test(Integer size) {
        int i = 0;
        do {
            int a = 1;
            int b = 4;
            int c = a + b;
            log.info("");
//            ThreadUtil.sleep(500);
            i++;
        } while (i <= size);
        return Results.ok();
    }
}
